<?php
/**
*	作者：信呼开发团队(雨中磐石)
*	官网：http://www.rockoa.com
*	软件：信呼在线客服系统
*	用户信息
*/
class usersClassModel extends Model
{
	public $rsrrs = array();
	
	/**
	*	获取人员
	*/
	public function getList()
	{
		$rows = $this->getall("`status`=1 and `islxr`=1",'`id`,`email`,`name`,`mobile`,`face`,`type`,`ranking`','`sort` asc');
		foreach($rows as $k=>$rs){
			$rows[$k]['face'] 	= $this->getface($rs['face']);
			$rows[$k]['ranking']= $this->rock->repempt($rs['ranking']);
		}
		return $rows;
	}
	
	
	public function getface($face)
	{
		$url = getconfig('outurl',URL);
		if(isempt($face))$face = 'images/noface.png';
		if(substr($face,0,4)!='http'){
			$face = ''.$url.''.$face.'';
		}
		return $face;
	}
	
	
	/**
	*	获取人员信息
	*/
	public function geturs($id)
	{
		$urs = $this->getXinxi($id);
		if($urs)$urs['face'] = $this->getface($urs['face']);
		return $urs;
	}
	
	/**
	*	获取应用下所有客服id
	*/
	public function getuids($agentid=0)
	{
		$ids  = '';
		$where= '';
		if($agentid>0){
			$agrs	= m('agent')->getone($agentid);
			$zdis	= '';
			if($agrs){
				$fzid 	= $agrs['fzid'];
				$kefuid = $agrs['kefuid'];
				if(!isempt($fzid))$zdis.=','.$fzid.'';
				if(!isempt($kefuid))$zdis.=','.$kefuid.'';
			}
			if($zdis)$where='and `id` in('.substr($zdis,1).')';
		}
		if($where=='')return '';
		$rows = $this->getall('`status`=1 '.$where.'');
		foreach($rows as $k=>$rs){
			$ids.=','.$rs['id'].'';
		}
		if($ids)$ids = substr($ids, 1);
		return $ids;
	}
	
	
	//这个没什么用
	public function rocktemepstr()
	{
		
	}
}